package com.example.flower_shop.dto.user;

import com.example.flower_shop.entity.User;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class UserVO {
    private Long id;
    private String username;
    private String nickname;
    private String avatarUrl;
    private Integer gender;
    private String phone;
    private String role;
    private String token;

    public UserVO(User user) {
        this.id = user.getId();
        this.username = user.getUsername();
        this.nickname = user.getNickname();
        this.avatarUrl = user.getAvatarUrl();
        this.gender = user.getGender();
        this.phone = user.getPhone();
        this.role = user.getRole().name();
    }

    public UserVO(User user, String token) {
        this(user);
        this.token = token;
    }
}